<template>
  <div>
    <button @click="getStudents">获取学生信息</button>
    <button @click="getCars">获取汽车信息</button>


  </div>

</template>

<script>
import axios from "axios";

export default {
  name: 'App',
  methods: {
    getStudents: function () {
      axios.get('http://127.0.0.1:8080/atguigu/getStudents').then(
          (resp) => {
            console.log(resp.data)

          },
          (error) => {
            console.log(error.message)
          }
      )
    },
    getCars:function (){
      axios.get('http://127.0.0.1:8080/demo/getCars').then(
          (resp) => {
            console.log(resp.data)

          },
          (error) => {
            console.log(error.message)
          }
      )
    }
  }


}
</script>

<style>

</style>
